package org.charles.zhifou.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.charles.zhifou.enums.UserRoleEnum;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * 用户
 * @TableName user
 */
@Data
public class User implements Serializable {
    @Schema(description = "id")
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    @Schema(description = "账号")
    private String userAccount;

    @Schema(description = "密码")
    private String userPassword;

    @Schema(description = "微信开放平台 id")
    private String unionId;

    @Schema(description = "公众号 openId")
    private String mpOpenId;

    @Schema(description = "用户昵称")
    private String userName;

    @Schema(description = "用户头像")
    private String userAvatar;

    @Schema(description = "用户简介")
    private String userProfile;

    @Schema(description = "用户角色: 0-普通用户, 1-管理员, 2-被封号")
    private UserRoleEnum userRole;

    @Schema(description = "创建时间")
    private Date createTime;

    @Schema(description = "更新时间")
    private Date updateTime;

    @Schema(description = "是否删除")
    @TableLogic
    @JsonIgnore
    private Integer isDeleted;

    @Serial
    private static final long serialVersionUID = 1L;
}